package com.lahuan.config.integration;

import com.lahuan.demo.entity.Order;
import org.springframework.integration.core.GenericSelector;
import org.springframework.stereotype.Component;

/**
 * Spring Integration过滤器
 */
@Component
public class RegisterMessageFilter implements GenericSelector<Order> {
    @Override
    public boolean accept(Order order) {
        boolean res = order != null && order.getId() != null && !order.getId().equals(0L);
        if(!res){
            System.out.println("请求被拦截");
        }
        return res;
    }
}
